var mongoose = require('mongoose')

mongoose.connect('mongodb://localhost/data',{ useNewUrlParser: true })

var Schema = mongoose.Schema

var dataSchema = new Schema({
    url: {
        type: String,
        required: true
    },
    title: {
        type: String,
        required: true
    },
    pinglun: {
        type: String,
        required: true
    },
    click: {
        type: Number,
        required: true
    },
    id: {
        type: Number,
        required: true
    }
})

module.exports = mongoose.model('data', dataSchema)


